import time

def bubble_sort(arr):
    n = len(arr)
    swapped = False
    for i in range(n-1):
        for j in range(n-i-1):
            if arr[j] > arr[j+1]:
                arr[j], arr[j+1] = arr[j+1], arr[j]
                swapped = True
        if not swapped:
            break
    return arr

def sort_file(filename):
    with open(filename, 'r') as file:
        values = [int(line.strip()) for line in file]
    start_time = time.time()
    sorted_values = bubble_sort(values)
    end_time = time.time()
    elapsed_time = (end_time - start_time) * 1000
    print(f"Sorting time for {filename}: {elapsed_time} milliseconds")
